<?php htmlTemplate('admin_header_frame.php');?>
<script type="text/javascript">
<!--
function checkForm(){
	var name = $.trim($("#cate_name").val());
	var sort =  $.trim($("#sort").val());
	if (name==''){	
		parent.showAlert('分类名称不能为空！');
		
	}else{
		<?php
		if ($cate) {
			$url=ZSM_WWW_HOST.'admin/news/catemodify/do/update/id/'.$cate['id'];
		}else{
			$url=ZSM_WWW_HOST.'admin/news/cateadd/do/add';
		}
		?>
		var url = '<?php echo $url;?>';
		
		$.getJSON(url,{'name':name,'sort':sort},function(rs){
			if(rs.status==1){
				parent.showAlert(rs.html);
				setTimeout(function(e){
					tourl('<?php echo ZSM_WWW_HOST.'admin/news/cate';?>');
				},3000);
			}else{
				parent.showAlert(rs.html);
			}
		})
	}
	return false;
}
//-->
</script>

<form action="" method="post" onsubmit="return checkForm();">
<table style="width:100%;line-height: 35px;">
	<tr>
		<td align="right" width="50%">新闻分类名称： </td>
		<td align="left" width="50%" >
		<?php if ($cate){?>
		<input type="text" style="width:200px;" name="cate_name" id="cate_name" value="<?php echo $cate['name'];?>">
		<?php }else{?>
		<input type="text" style="width:200px;" name="cate_name" id="cate_name">
		<?php }?>
		</td>
		
	</tr>
	<tr>
		<td align="right" width="50%">排列顺序： </td>
		<td align="left" width="50%" >
		<?php if ($cate){?>
		<input type="text" style="width:200px;" name="sort" id="sort" value="<?php echo $cate['sort'];?>">
		<?php }else{?>
		<input type="text" style="width:50px;" name="sort" id="sort">(0,1,2,3）数字越小排在越前面
		<?php }?></td>
		</tr>
	<tr>
		<td align="right"  width="50%" ><input type="submit" value="确 认">&nbsp;</td>
		<td align="left"  width="50%" >&nbsp;</td>
		
	</tr>
	
</table>
</form>